﻿// -----------------------------------------------------------------------
// <copyright file="ManageConfiguration.cs" company="Microsoft">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

using System;
using System.Configuration;

namespace Encryption
{
    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    public class ManageConfiguration
    {
        private Configuration configObj;

        public bool GetConfig()
        {
            bool bResult = false;

            try
            {
                configObj = ConfigurationManager.OpenExeConfiguration( ConfigurationUserLevel.None );
                bResult = true;
            }
            catch ( Exception ) {}

            return bResult;
        }

        public bool GetInfoConfig(string sectionName, out AppSettingsSection sectionConfig )
        {
            bool bResult = false;
            sectionConfig = null;

            sectionConfig = (AppSettingsSection) configObj.GetSection( sectionName );
            return bResult;
        }
    }
}
